<%@ Page Title="Member_Certified List" Language="C#" AutoEventWireup="true" CodeBehind="Member_CertifiedList.aspx.cs" Inherits="Youz.CreditRepay.Manage.Member_CertifiedList" %>

<%@ Register Src="~/Controls/_AuditStateControl.ascx" TagPrefix="uc1" TagName="_AuditStateControl" %>


<script>
    //loadCSS("assets/plugins/gritter/css/jquery.gritter.css");

    var requireJS = [
        //"assets/plugins/gritter/js/jquery.gritter.min.js"
    ];

    loadJS(requireJS);
    $(function () {
        $('.form_date').datetimepicker({
            language: "zh_CN",
            format: "yyyy-mm-dd",
            autoclose: true,
            todayBtn: true,
            todayHighlight: true,
            pickerPosition: "bottom-left",
            startView: 2,
            minView: 2,
            forceParse: 0
        });
    });
</script>
<div class="row">
    <div class="col-lg-12">
        <div class="panel panel-default">
            <div class="panel-heading" data-original-title>
                <h2><i class="fa fa-align-justify"></i><span style="font-size: 16px; padding-right: 15px;">身份认证</span></h2>
                <div class="panel-actions"></div>
            </div>
            <div class="panel-body">
                <div class="alert alert-danger" style="display: none;">
                    <button type="button" class="close" data-dismiss="alert">×</button><strong><i class="fa fa-warning"></i></strong><span class="content"></span>
                </div>
                <form class="form-horizontal">
                    <div class="row">
                        <div class="col-md-3">
                            <div class="form-group">
                                <label class="col-md-3 control-label"><%: R(LanguageModule.M_Common, "MemberAccount", "会员帐号") %></label>
                                <div class="col-md-9">
                                    <input type="email" id="MemberAccount" maxlength="100" name="MemberAccount" class="form-control" placeholder="<%: R(LanguageModule.M_Common, "MemberAccount", "会员帐号") %>">
                                </div>
                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="form-group">
                                <label class="col-md-3 control-label" for="RoleDesc"><%: R(LanguageModule.M_Common, "Status", "状态") %></label>
                                <div class="col-md-9">
                                    <uc1:_AuditStateControl runat="server" ID="_AuditStateControl" />
                                </div>
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label class="col-md-3 control-label"><%: R(LanguageModule.Member_Info, "CreateTime", "创建时间") %></label>
                                <div class="col-md-9">
                                    <div class="input-group">
                                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                                        <input type="text" data-date-format="yyyy/mm/dd" id="StartDate" class="form-control form_date" />
                                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                                        <input type="text" data-date-format="yyyy/mm/dd" id="EndDate" class="form-control form_date" />
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-2">
                            <button type="button" id="btnQuery" name="btnQuery" class="btn btn-default btn-ar btn-primary">
                                <i class="fa fa-search "></i>
                                <%: R(LanguageModule.M_Common, "Query") %>
                            </button>
                        </div>
                    </div>
                </form>
                <table id="table" class="table table-striped table-bordered dt-responsive nowrap" cellspacing="0" width="100%"></table>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    var dt;

    $(function () {

        dt = $('#table').DataTable({
            "ajax": {
                "url": 'Member/Handlers/Member_CertifiedHandler.ashx?type=list',
                "type": "POST",
                "dataSrc": "data",
                "data": function (d) {
                    d.MemberAccount = $('#MemberAccount').val();
                    d.Status = $('#Status').val();
                    d.StartDate = $('#StartDate').val();
                    d.EndDate = $('#EndDate').val();
                }
            },
            "columns": [
                    { "data": 'RowIndex', "title": "#" },
                    {
                        data: "CertifiedID",
                        title: '操作',
                        width: 60,
                        render: function (data, type, row) {
                            if (row.Status == 0 || row.Status == 1) {
                                return "<a href='javascript:;' class='btn btn-info btn-xs' title='审核' onclick='Audit(\"" + row.CertifiedID + "\")'><i class='fa fa-pencil'> 审核</i></a>";
                            }
                            else {
                                return "<a href='javascript:;' class='btn btn-default btn-xs active' title='查看' onclick='View(\"" + row.CertifiedID + "\")'><i class='fa fa-eye'> 查看</i></a>";
                            }
                        },
                        className: "dt-body-center"
                    },
                    { "data": 'MemberAccount', "title": "会员帐号" },
                    { "data": 'Name', "title": "姓名" },
                    { "data": 'CredentialsNum', "title": "身份证号" },
                    { "data": 'Status', "title": "<%: R(LanguageModule.Member_Certified, "Status", "状态") %>", render: fStatus },
                    { "data": 'CreateTime', "title": "创建时间" },
                    { "data": 'AuditTime', "title": "审核时间" },

            ]
        });

        $('#btnQuery').click(function () {
            if (validateStartDateEndDate($('#StartDate').val(), $('#EndDate').val())) {
                dt.ajax.reload();
            }
        });


    });

    //审核
    function Audit(CertifiedID) {
        if (CertifiedID.length > 0) {
            loadPage("Member/Member_CertifiedItem.aspx?CertifiedID=" + CertifiedID);
        }
    }
    //查看
    function View(CertifiedID) {
        if (CertifiedID.length > 0) {
            loadPage("Member/Member_CertifiedItem.aspx?CertifiedID=" + CertifiedID + "&View=1");
        }
    }
</script>
